/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Logico;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author usuario
 */
@Entity
@Table(name = "boleta")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Boleta.findAll", query = "SELECT b FROM Boleta b"),
    @NamedQuery(name = "Boleta.findByIdboleteria", query = "SELECT b FROM Boleta b WHERE b.idboleteria = :idboleteria"),
    @NamedQuery(name = "Boleta.findByEstado", query = "SELECT b FROM Boleta b WHERE b.estado = :estado"),
    @NamedQuery(name = "Boleta.findByFechaingreso", query = "SELECT b FROM Boleta b WHERE b.fechaingreso = :fechaingreso"),
    @NamedQuery(name = "Boleta.findByHoraingreso", query = "SELECT b FROM Boleta b WHERE b.horaingreso = :horaingreso"),
    @NamedQuery(name = "Boleta.findByTipo", query = "SELECT b FROM Boleta b WHERE b.tipo = :tipo"),
    @NamedQuery(name = "Boleta.findByCosto", query = "SELECT b FROM Boleta b WHERE b.costo = :costo")})
public class Boleta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idboleteria")
    private Integer idboleteria;
    @Column(name = "estado")
    private String estado;
    @Column(name = "fechaingreso")
    @Temporal(TemporalType.DATE)
    private Date fechaingreso;
    @Column(name = "horaingreso")
    private String horaingreso;
    @Basic(optional = false)
    @Column(name = "tipo")
    private String tipo;
    @Basic(optional = false)
    @Column(name = "costo")
    private int costo;
    @JoinColumn(name = "competencia_idcompetencia", referencedColumnName = "idcompetencia")
    @ManyToOne(optional = false)
    private Competencia competenciaIdcompetencia;

    public Boleta() {
    }

    public Boleta(Integer idboleteria) {
        this.idboleteria = idboleteria;
    }

    public Boleta(Integer idboleteria, String tipo, int costo) {
        this.idboleteria = idboleteria;
        this.tipo = tipo;
        this.costo = costo;
    }

    public Integer getIdboleteria() {
        return idboleteria;
    }

    public void setIdboleteria(Integer idboleteria) {
        this.idboleteria = idboleteria;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public Date getFechaingreso() {
        return fechaingreso;
    }

    public void setFechaingreso(Date fechaingreso) {
        this.fechaingreso = fechaingreso;
    }

    public String getHoraingreso() {
        return horaingreso;
    }

    public void setHoraingreso(String horaingreso) {
        this.horaingreso = horaingreso;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public int getCosto() {
        return costo;
    }

    public void setCosto(int costo) {
        this.costo = costo;
    }

    public Competencia getCompetenciaIdcompetencia() {
        return competenciaIdcompetencia;
    }

    public void setCompetenciaIdcompetencia(Competencia competenciaIdcompetencia) {
        this.competenciaIdcompetencia = competenciaIdcompetencia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idboleteria != null ? idboleteria.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Boleta)) {
            return false;
        }
        Boleta other = (Boleta) object;
        if ((this.idboleteria == null && other.idboleteria != null) || (this.idboleteria != null && !this.idboleteria.equals(other.idboleteria))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Logico.Boleta[ idboleteria=" + idboleteria + " ]";
    }
    
}
